@echo ===================================================
@echo ===================================================
@echo =========== LACONIC ERP IMPORT DATABASE ===========
@echo ===================================================
@echo ===================================================
@echo ================ Please wait...... ================
@echo ===================================================
@echo ===================================================

@echo off
if "%OS%" == "Windows_NT" setlocal
rem -----------------------------------------------------
rem Start script for import Laconic database
rem $Id: import.bat,
rem -----------------------------------------------------

rem Enter your TNS name of import target
set DATABASE=LACONIC
rem Enter your DB dump file name
set FILE_NAME=LACONIC.DMP

> usermessage.vbs ECHO WScript.Echo InputBox( "Please enter target database... ", "TNS Name:", "LACONIC" )
FOR /F "tokens=*" %%A IN ('CSCRIPT.EXE //NoLogo usermessage.vbs') DO SET DATABASE=%%A
ECHO DATABASE=%DATABASE%
DEL usermessage.vbs

FOR /F "tokens=*" %%A IN ('CSCRIPT.EXE //NoLogo import_file.vbs') DO SET FILE_NAME=%%A
ECHO FILE_NAME=%FILE_NAME%


:: password for laconic is in UPPERCASE, the rest is whatever

sqlplus system/laconic@%DATABASE% @Scripts/dropLaconic.sql
pause
sqlplus system/laconic@%DATABASE% @Scripts/createLaconic.sql
pause
imp LACONIC/LACONIC@%DATABASE% file=%FILE_NAME% rows=y ignore=y grants=y full=y
pause
::exit
